﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Review
{
    class Father
    {
        public string name;  
       
        public Father(string name)
        {
            this.name = name;
        }
        public virtual void  eat() 
        {
            Console.WriteLine("我是{0},我会吃！",this.name);
        }
    }

    class Cat : Father, Itree
    {
        public Cat(string name) : base(name)
        {
            this.name = name;
        }

        public void Itree()
        {
            Console.WriteLine("我能爬树"); ;
        }
        public override void eat()
        {
            base.eat();
            Console.WriteLine("我会吃鱼");
        }

    }
    class monkey : Father, Itree
    {
        public monkey(string name) : base(name)
        {
            this.name = name;
        }
        public void Itree()
        {
            Console.WriteLine("我能爬树"); ;
        }
    }

    class dog : Father, Iswim
    {
        public dog(string name) : base(name)
        {
            this.name = name;
        }
        public void Iswim()
        {
            Console.WriteLine("我会游泳！");
        }

        public override void eat()
        {
            base.eat();
            Console.WriteLine("我会吃骨头！");
        }
    }

    class duck : Father, Iswim
    {
        public duck(string name) : base(name)
        {
            this.name = name;
        }
        

        public override void eat()
        {
            base.eat();
            Console.WriteLine("我会吃虫子！");
        }



        public void Iswim()
        {
            Console.WriteLine("我会游泳！");
        }
    }
}
